import {createI18n} from "vue-i18n";
import EnUS from "@/local/en-US";
import ZhCN from "@/local/zh-CN";
import Local from "@/utils/local";

const i18n = createI18n({
    legacy: false, // 必须设置false才能使用Composition API
    globalInjection: true, // 为每个组件注入$为前缀的全局属性和函数
    fallbackLocale: 'zh', // 备用语言
    locale: Local.localRead('language') || 'zh',
    messages: {
        en: EnUS,
        zh: ZhCN
    }
})


export default i18n;